home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / 3d_vb / 3d4vb.bas < prev    next >
BASIC Source File  |  1995-09-06  |  21KB  |  637 lines

  1.  
  2.  
  3.  
  4. Sub BorderBox (Ctrl1 As Control, Ctrl2 As Control, H%)
  5.     OldDWVal = Ctrl2.DrawWidth
  6.     Ctrl2.DrawWidth = 1
  7.     Cleft% = Ctrl1.Left - 15
  8.     CTop% = Ctrl1.Top - 15
  9.     Cwide% = Ctrl1.Width + 20
  10.     Chigh% = Ctrl1.Height + 15
  11.     Ctrl2.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
  12.     Ctrl2.Line -Step(0, Chigh%), WHITE
  13.     Ctrl2.Line -Step(-Cwide%, 0), WHITE
  14.     Ctrl2.Line -Step(0, -Chigh%), GRAY
  15.     If H% = 2 Then
  16.         Cleft% = Ctrl1.Left - 30
  17.         CTop% = Ctrl1.Top - 30
  18.         Cwide% = Ctrl1.Width + 50
  19.         Chigh% = Ctrl1.Height + 40
  20.         Ctrl2.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
  21.         Ctrl2.Line -Step(0, Chigh%), WHITE
  22.         Ctrl2.Line -Step(-Cwide%, 0), WHITE
  23.         Ctrl2.Line -Step(0, -Chigh%), GRAY
  24.     End If
  25.     Ctrl2.DrawWidth = OldDWVal
  26. End Sub     ' BorderBox()
  27.  
  28.  
  29. Sub BorderBoxOnFrm (Ctrl1 As Control, Ctrl2 As Form)
  30.     OldDWVal = Ctrl2.DrawWidth
  31.     Ctrl2.DrawWidth = 1
  32.     Cleft% = Ctrl1.Left - 15
  33.     CTop% = Ctrl1.Top - 15
  34.     Cwide% = Ctrl1.Width + 20
  35.     Chigh% = Ctrl1.Height + 20
  36.     Ctrl2.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
  37.     Ctrl2.Line -Step(0, Chigh%), WHITE
  38.     Ctrl2.Line -Step(-Cwide%, 0), WHITE
  39.     Ctrl2.Line -Step(0, -Chigh%), GRAY
  40.     Cleft% = Ctrl1.Left - 30
  41.     CTop% = Ctrl1.Top - 30
  42.     Cwide% = Ctrl1.Width + 45
  43.     Chigh% = Ctrl1.Height + 45
  44.     Ctrl2.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
  45.     Ctrl2.Line -Step(0, Chigh%), WHITE
  46.     Ctrl2.Line -Step(-Cwide%, 0), WHITE
  47.     Ctrl2.Line -Step(0, -Chigh%), GRAY
  48.     Ctrl2.DrawWidth = OldDWVal
  49. End Sub     ' BorderBoxOnFrm()
  50.  
  51. Sub EtchedFrame (Ctrl1 As Control, Text$, Just%, ColorVal, Dimen%)
  52.     OldDWVal = Ctrl1.DrawWidth
  53.     Ctrl1.DrawWidth = 1
  54.     ' 0 = Left, 1 = Right, 2 = Center
  55.     TxLen% = Ctrl1.TextWidth(Text$)
  56.     Ctrl1.ForeColor = ColorVal
  57.     C1Left% = Ctrl1.ScaleLeft + 10
  58.     C1Top% = Ctrl1.ScaleTop + (Ctrl1.TextHeight("I") / 2)
  59.     C1Wide% = Ctrl1.ScaleWidth - 30
  60.     C1High% = (Ctrl1.ScaleHeight - 30)
  61.     C2Left% = Ctrl1.ScaleLeft
  62.     C2Top% = Ctrl1.ScaleTop + ((Ctrl1.TextHeight("I") / 2) - 10)
  63.     C2Wide% = Ctrl1.ScaleWidth - 15
  64.     C2High% = (Ctrl1.ScaleHeight - 10)
  65.     Select Case Just%
  66.     Case Is = 0     ' Left
  67.         L1Start% = C1Left%
  68.         L1End% = 120
  69.         R1Start% = L1End% + TxLen% + 240
  70.         R1End% = C1Wide%
  71.         L2Start% = C2Left%
  72.         L2End% = 110
  73.         R2Start% = L2End% + TxLen% + 240
  74.         R2End% = C2Wide%
  75.         Xpos% = 240
  76.         Ypos% = 0
  77.     Case Is = 1     ' Right
  78.         L1Start% = C1Left%
  79.         L1End% = (C1Wide% - TxLen%) - 350
  80.         R1Start% = C1Wide% - 120
  81.         R1End% = C1Wide%
  82.         L2Start% = C2Left%
  83.         L2End% = (C2Wide% - TxLen%) - 350
  84.         R2Start% = C2Wide% - 130
  85.         R2End% = C2Wide%
  86.         Xpos% = L1End% + 120
  87.         Ypos% = 0
  88.     Case Is = 2     ' Center
  89.         L1Start% = C1Left%
  90.         L1End% = (C1Wide% - (TxLen% + 240)) / 2
  91.         R1Start% = C1Wide% - L1End%
  92.         R1End% = C1Wide%
  93.         L2Start% = C2Left%
  94.         L2End% = (C2Wide% - (TxLen% + 240)) / 2
  95.         R2Start% = C2Wide% - L2End%
  96.         R2End% = C2Wide%
  97.         Xpos% = L1End% + 120
  98.         Ypos% = 0
  99.     End Select
  100.     If Dimen% = ETCHED Then
  101.            Ctrl1.Currentx = Xpos% + 15
  102.            Ctrl1.Currenty = Ypos% + 15
  103.            Ctrl1.ForeColor = WHITE
  104.            Ctrl1.Print Text$
  105.     End If
  106.     If Dimen% = RAISED Then
  107.            Ctrl1.Currentx = Xpos% - 15
  108.            Ctrl1.Currenty = Ypos% - 15
  109.            Ctrl1.ForeColor = WHITE
  110.            Ctrl1.Print Text$
  111.            Ctrl1.Currentx = Xpos% + 15
  112.            Ctrl1.Currenty = Ypos% + 15
  113.            Ctrl1.ForeColor = GRAY
  114.            Ctrl1.Print Text$
  115.     End If
  116.     Ctrl1.Currentx = Xpos%
  117.     Ctrl1.Currenty = Ypos%
  118.     Ctrl1.ForeColor = ColorVal
  119.     Ctrl1.Print Text$
  120.     Ctrl1.Line (L1Start%, C1Top%)-(L1End%, C1Top%), WHITE
  121.     Ctrl1.Line (R1Start%, C1Top%)-(R1End%, C1Top%), WHITE
  122.     Ctrl1.Line (R1End%, C1Top%)-(R1End%, C1High%), GRAY
  123.     Ctrl1.Line (R1End%, C1High%)-(L1Start%, C1High%), GRAY
  124.     Ctrl1.Line (L1Start%, C1High%)-(L1Start%, C1Top%), WHITE
  125.     Ctrl1.Line (L2Start%, C2Top%)-(L2End%, C2Top%), GRAY
  126.     Ctrl1.Line (R2Start%, C2Top%)-(R2End%, C2Top%), GRAY
  127.     Ctrl1.Line (R2End%, C2Top%)-(R2End%, C2High%), WHITE
  128.     Ctrl1.Line (R2End%, C2High%)-(L2Start%, C2High%), WHITE
  129.     Ctrl1.Line (L2Start%, C2High%)-(L2Start%, C2Top%), GRAY
  130.     Ctrl1.DrawWidth = OldDWVal
  131. End Sub     ' EtchedFrame()
  132.  
  133. Sub EtchedFrmLine (Ctrl1 As Form, X1pos%, Y1pos%, X2pos%, Y2pos%)
  134.     OldDWVal = Ctrl1.DrawWidth
  135.     Ctrl1.AutoRedraw = True
  136.     Ctrl1.DrawWidth = 1
  137.     Ctrl1.Line (X1pos%, Y1pos%)-(X2pos%, Y2pos%), GRAY
  138.     Ctrl1.Line (X1pos% + 15, Y1pos% + 15)-(X2pos% + 15, Y2pos% + 15), WHITE
  139.     Ctrl1.DrawWidth = OldDWVal
  140. End Sub     ' EtchedFrmLine()
  141.  
  142. Sub EtchedFrmText (Ctrl1 As Form, Text$, Xpos%, Ypos%, ColorVal)
  143.     OldDWVal = Ctrl1.DrawWidth
  144.     Ctrl1.DrawWidth = 1
  145.     StartColor = Ctrl1.ForeColor
  146.     Ctrl1.Currentx = Xpos% + 15
  147.     Ctrl1.Currenty = Ypos% + 15
  148.     Ctrl1.ForeColor = WHITE
  149.     Ctrl1.Print Text$
  150.     Ctrl1.Currentx = Xpos%
  151.     Ctrl1.Currenty = Ypos%
  152.     Ctrl1.ForeColor = ColorVal
  153.     Ctrl1.Print Text$
  154.     Ctrl1.ForeColor = StartColor
  155.     Ctrl1.DrawWidth = OldDWVal
  156. End Sub     ' EtchedFrmText()
  157.  
  158.  
  159.  
  160. Sub EtchedPicBorder (Ctrl1 As Control)
  161.     OldDWVal = Ctrl1.DrawWidth
  162.     Ctrl1.DrawWidth = 1
  163.     Cleft% = Ctrl1.ScaleLeft + 10
  164.     CTop% = Ctrl1.ScaleTop + 10
  165.     Cwide% = Ctrl1.ScaleWidth - 30
  166.     Chigh% = Ctrl1.ScaleHeight - 30
  167.     Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), WHITE
  168.     Ctrl1.Line -Step(0, Chigh%), GRAY
  169.     Ctrl1.Line -Step(-Cwide%, 0), GRAY
  170.     Ctrl1.Line -Step(0, -Chigh%), WHITE
  171.     Cleft% = Ctrl1.ScaleLeft
  172.     CTop% = Ctrl1.ScaleTop
  173.     Cwide% = Ctrl1.ScaleWidth - 15
  174.     Chigh% = Ctrl1.ScaleHeight - 15
  175.     Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
  176.     Ctrl1.Line -Step(0, Chigh%), WHITE
  177.     Ctrl1.Line -Step(-Cwide%, 0), WHITE
  178.     Ctrl1.Line -Step(0, -Chigh%), GRAY
  179.     Ctrl1.DrawWidth = OldDWVal
  180. End Sub ' EtchedPicBorder()
  181.  
  182. Sub EtchedPicText (Ctrl1 As Control, Text$, Xpos%, Ypos%, ColorVal)
  183.     OldDWVal = Ctrl1.DrawWidth
  184.     Ctrl1.DrawWidth = 1
  185.     StartColor = Ctrl1.ForeColor
  186.     Ctrl1.Currentx = Xpos% + 15
  187.     Ctrl1.Currenty = Ypos% + 15
  188.     Ctrl1.ForeColor = WHITE
  189.     Ctrl1.Print Text$
  190.     Ctrl1.Currentx = Xpos%
  191.     Ctrl1.Currenty = Ypos%
  192.     Ctrl1.ForeColor = ColorVal
  193.     Ctrl1.Print Text$
  194.     Ctrl1.ForeColor = StartColor
  195.     Ctrl1.DrawWidth = OldDWVal
  196. End Sub     ' EtchedPicText()
  197.  
  198. Sub FormBorder (Ctrl1 As Form)
  199.     OldDWVal = Ctrl1.DrawWidth
  200.     Ctrl1.DrawWidth = 1
  201.     Cleft% = Ctrl1.ScaleLeft
  202.     CTop% = Ctrl1.ScaleTop
  203.     Cwide% = Ctrl1.ScaleWidth - 15
  204.     Chigh% = Ctrl1.ScaleHeight - 15
  205.     Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), WHITE
  206.     Ctrl1.Line -Step(0, Chigh%), GRAY
  207.     Ctrl1.Line -Step(-Cwide%, 0), GRAY
  208.     Ctrl1.Line -Step(0, -Chigh%), WHITE
  209.     Cleft% = Ctrl1.ScaleLeft + 15
  210.     CTop% = Ctrl1.ScaleTop + 15
  211.     Cwide% = Ctrl1.ScaleWidth - 45
  212.     Chigh% = Ctrl1.ScaleHeight - 45
  213.     Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), WHITE
  214.     Ctrl1.Line -Step(0, Chigh%), GRAY
  215.     Ctrl1.Line -Step(-Cwide%, 0), GRAY
  216.     Ctrl1.Line -Step(0, -Chigh%), WHITE
  217.     Ctrl1.DrawWidth = OldDWVal
  218. End Sub     ' FormBorder()
  219.  
  220.  
  221. Sub FormFrame (Ctrl1 As Form)
  222.     OldDWVal = Ctrl1.DrawWidth
  223.     Ctrl1.DrawWidth = 1
  224.     Cleft% = Ctrl1.ScaleLeft + 60
  225.     CTop% = Ctrl1.ScaleTop + 60
  226.     Cwide% = Ctrl1.ScaleWidth - 130
  227.     Chigh% = Ctrl1.ScaleHeight - 130
  228.     Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
  229.     Ctrl1.Line -Step(0, Chigh%), WHITE
  230.     Ctrl1.Line -Step(-Cwide%, 0), WHITE
  231.     Ctrl1.Line -Step(0, -Chigh%), GRAY
  232.     Cleft% = Ctrl1.ScaleLeft
  233.     CTop% = Ctrl1.ScaleTop
  234.     Cwide% = Ctrl1.ScaleWidth - 10
  235.     Chigh% = Ctrl1.ScaleHeight - 10
  236.     Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), WHITE
  237.     Ctrl1.Line -Step(0, Chigh%), GRAY
  238.     Ctrl1.Line -Step(-Cwide%, 0), GRAY
  239.     Ctrl1.Line -Step(0, -Chigh%), WHITE
  240.     Ctrl1.DrawWidth = OldDWVal
  241. End Sub     ' FormFrame()
  242.  
  243.  
  244. Sub HighlightEntry